<?php
//意见反馈
header("Content-type:text/html; charset=utf-8;");
require '../../../ppf/fun.php';
require '../../../ppf/pdo_mysql.php';
$pd = new pdo_mysql();
session_start();

if (empty($_SESSION['uid'])) {
    $tips = array(
        'tips' => '请登录后再进行操作',
        'url' => 'index.php'
    );
    $tips = urlencode(serialize($tips));
    header('Location:/tips.php?gets=' . $tips);
    exit;
}
if (empty($_POST['id'])) {
    echo "无效参数";
    exit;
}
$data['file_id'] = $_POST['id'];
$data['contents'] = $_POST['content'];
$data['backtime']=date("Y-m-d H:i:s");
$data['user_id']=$_SESSION['username'];
$res=$pd->insert(array('data' => $data, 'table' => 'back_views'));
if (!$res) {
    echo json_encode(array("tips" => "反馈失败", "status" => false));
} else {
    
    echo json_encode(array("tips" => "反馈成功", "status" => true));
}
?>